﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Wpf.Ui.FunnyArtsExtensions.Controls.ProgressBar
{
    /// <summary>
    /// LoadingProgressBar.xaml 的交互逻辑
    /// </summary>
    public class LoadingProgressBar : Control
    {
        /// <summary>
        /// 标题
        /// </summary>
        public static readonly DependencyProperty HeaderTitleProperty = DependencyProperty.Register(
        nameof(HeaderTitle),
        typeof(string),
        typeof(LoadingProgressBar),
        new PropertyMetadata(null)
        );
        /// <summary>
        /// 内容
        /// </summary>
        public static readonly DependencyProperty MsgContextProperty = DependencyProperty.Register(
        nameof(MsgContext),
        typeof(string),
        typeof(LoadingProgressBar),
        new PropertyMetadata(null)
        );

        /// <summary>
        /// 总进额度
        /// </summary>
        public static readonly DependencyProperty MaxNumProperty = DependencyProperty.Register(
        nameof(MaxNum),
        typeof(int),
        typeof(LoadingProgressBar),
        new PropertyMetadata(0)
        );
        /// <summary>
        /// 当前进度
        /// </summary>
        public static readonly DependencyProperty CurrentNumProperty = DependencyProperty.Register(
        nameof(CurrentNum),
        typeof(int),
        typeof(LoadingProgressBar),
        new PropertyMetadata(0)
        );
        [Bindable(true), Category("Appearance")]
        public string HeaderTitle
        {
            get => (string)GetValue(HeaderTitleProperty);
            set => SetValue(HeaderTitleProperty, value);
        }
        [Bindable(true), Category("Appearance")]
        public string MsgContext
        {
            get => (string)GetValue(MsgContextProperty);
            set => SetValue(MsgContextProperty, value);
        }
        [Bindable(true), Category("Appearance")]
        public int MaxNum
        {
            get => (int)GetValue(MaxNumProperty);
            set => SetValue(MaxNumProperty, value);
        }
        [Bindable(true), Category("Appearance")]
        public int CurrentNum
        {
            get => (int)GetValue(CurrentNumProperty);
            set => SetValue(CurrentNumProperty, value);
        }
    }
}
